home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / CM-INT.ZIP;1 / CM-INT.DOC < prev    next >
Encoding:
Text File  |  1993-04-10  |  13.3 KB  |  288 lines

  1.  
  2. ;------------------
  3. ;   CM-INT -- Interrupt Service by CMartin -- 2/22/92
  4. ;   Member ASP; CompuServe 72130,1400
  5. ;   The Program CM-INT is released as Freeware.  No contribution is expected.
  6. ;------------------
  7. ;   Intended as a tool kit for 80x86 Assembly Language programmers, this
  8. ;   service may also be useful to high level language programmers whose
  9. ;   language gives them access to the 80x86 interrupt architecture.
  10. ;   This interrupt service installs and stays resident, by including the
  11. ;   command CM-INT in autoexec.bat, and CM-INT.COM in root directory, or by
  12. ;   running CM-INT before any programs that use this interrupt service.
  13. ;   The functions in this service preserve the general purpose registers not
  14. ;   used for data transfer. They also preserve the segment, index and base
  15. ;   pointer registers.
  16. ;
  17. ;   This service is accessed via Int 0C0h, with function number passed through
  18. ;   bh. Description of each function follows:
  19. ;------------------
  20. ;
  21. ;   PAUSE
  22. ;       Function 00h: Pause until specific key is pressed.
  23. ;           Entry:  bl      - ASCII code of keypress required to
  24. ;                            release pause
  25. ;                   bh      - 00h
  26. ;           Return: None
  27. ;------------------
  28. ;
  29. ;   PRINT
  30. ;       Function 01h: Print string at current cursor position.
  31. ;           Entry:  ds:si   - pointer to ASCIIZ source string
  32. ;                   bh      - 01h
  33. ;           Return: None
  34. ;------------------
  35. ;
  36. ;   INPUT
  37. ;       Function 02h: Input a string from keyboard at current cursor position
  38. ;           Entry:  ds:si   - pointer to destination string
  39. ;                   bh      - 02h
  40. ;           Return: None
  41. ;------------------
  42. ;
  43. ;   SCAN (INPUT TO SCREEN) WITH PROMPT AND EDIT
  44. ;       Function 03h: Scan with prompt and editing at current cursor position
  45. ;           Entry:  ds:si   - pointer to ASCIIZ prompt string
  46. ;                   ds:di   - pointer to ASCIIZ destination string for
  47. ;                               data being entered/edited
  48. ;                   al      - data length - desired length of entry string
  49. ;                   ah      - data type -   0:no filtering
  50. ;                                           1:filter non-printable
  51. ;                                           2:numbers (0-9),blanks,and '+-'
  52. ;                                           3:numbers,blanks,and 'eE+-'
  53. ;                                           4:dates (0-9,'/-' and blank)
  54. ;                   bl      - 0=upper and lower case, >0=lower converted to
  55. ;                                  upper
  56. ;                   cl      - blank option- 0:no stripping
  57. ;                                           1:strip leading blanks
  58. ;                                           2:strip trailing blanks
  59. ;                                           3:strip both leading and trailing
  60. ;                   ch      - data window color (prompt field color is same
  61. ;                               backgnd as orig scrn attr, with hi intensity
  62. ;                               white foregnd. On exit, orig scrn attr are
  63. ;                               restored in all fields)
  64. ;                   bl      - 0:Upper and lower case; >0:Converts to upper
  65. ;                   bh      - 03h
  66. ;           Return: bl      - ASCII char code describing which keypress
  67. ;                               terminated data entry. A number of termination
  68. ;                               key combinations with corresponding codes are
  69. ;                               built in for versatility, and are all
  70. ;                               available. The returned byte ASCII character,
  71. ;                               the key combo that produces it, and the
  72. ;                               suggested usage follows:
  73. ;
  74. ;           'I'-<Ctrl><Rtn> {In}        'O'-<Ctrl><F10>-Delete block {Out}
  75. ;           'D'-Down arrow              'U'-Up arrow
  76. ;           'A'-<PgUp>                  'Z'-<PgDn>
  77. ;           'N'-<Ctrl>N-Insert New line 'Y'-<Ctrl>Y-Delete line
  78. ;           'L'-<Ctrl>L-Move Col Left   'R'-<Ctrl>R-Move Column Right
  79. ;           'C'-<Rtn> {Carriage}        'E'-<Esc>
  80. ;           'X'-Error - prompt plus data > 4 lines or off bottom of screen
  81. ;------------------
  82. ;
  83. ;   LINE PRINT
  84. ;       Function 04h: Print to parallel port printer
  85. ;           Entry:  ds:si   - pointer to string to be printed
  86. ;                   cx      - -1 means string is ASCIIZ and is to be printed
  87. ;                                   up to the terminal NULL
  88. ;                             Number other than -1 means print that number of
  89. ;                                   characters. (Permits 0 as a print control
  90. ;                                   character.)
  91. ;                   bh      - 04h
  92. ;           Returns: If print terminated by <Esc>, then leaves keypress in
  93. ;                             keyboard buffer, accessible by int 16h, func 1
  94. ;------------------
  95. ;
  96. ;   32-BIT NUMBER TO ASCIIZ
  97. ;       Function 06h: 32-bit binary number to ASCIIZ string
  98. ;           Entry:  dx:ax   - 32-bit signed binary number to be converted
  99. ;                   ds:si   - pointer to ASCIIZ destination string
  100. ;                   bl      - format for string:
  101. ;                               0=decimal,1=hex,2=octal,3=binary
  102. ;                   bh      - 03h
  103. ;           Returns: None
  104. ;------------------
  105. ;
  106. ;   ASCIIZ TO 32-BIT NUMBER
  107. ;       Function 07h: ASCIIZ string to 32-bit signed number
  108. ;           Operation:  Function scans from rightmost byte in string until
  109. ;                           beginning of field, ignoring illegal characters.
  110. ;                           Terminal h or H means hex;o or O octal; b or B bin
  111. ;           Entry:  ds:si   - pointer to ASCIIZ source string
  112. ;                   bh      - 04h
  113. ;           Returns: dx:ax  - 32-bit signed binary number  (0:0 for overflow)
  114. ;                    bl = 0 (normal return), -1 (overflow)
  115. ;------------------
  116. ;
  117. ;   JULIAN TO CALENDAR DATE
  118. ;       Function 10h: Convert julian date to calendar date.
  119. ;           Operation: Julian date is sent in on ax as unsigned 16-bit
  120. ;               binary number, where julian date 1=calendar date 1/1/1901.
  121. ;               Julian date <1 or >36525 (earlier that 1/1/1901 or later
  122. ;               that 12/31/2000 [12/31/00]) are illegal
  123. ;               Normalized calendar date (mm/dd/yy) is copied as ASCIIZ
  124. ;               string at the pointer provide by ds:si. If julian date
  125. ;               is in illegal range, the string '  /  /  ' is copied.
  126. ;               In addition, the day of the week is returned as a number
  127. ;               0-7 through bh (0=illegal,1=Sunday,etc.).The century
  128. ;               prefix (e.g., 19 for 1956) is passed through bl.
  129. ;           Entry:  bl      - century prefix
  130. ;                               (e.g., 19 is century prefix for 1978)
  131. ;                   ax      - julian date (unsigned 16-bit) (1=01/01/01)
  132. ;                   cx      - number of digits to display year (2 or 4),
  133. ;                               if century prefix is 19.
  134. ;                               (If century prefix not 19, 4 digits will be
  135. ;                               displayed, regardless of contents of cx)
  136. ;                   ds:si   - pointer to ASCIIZ destination string where
  137. ;                               calendar date is to be copied (11 bytes min)
  138. ;                   bh      - 10h
  139. ;           Return: ax      - julian date as unsigned 16-bit number
  140. ;                               (0 if illegal)
  141. ;                   bl      - century prefix
  142. ;                   bh      - day of week (0=illegal,1=Sunday,etc.)
  143. ;                   cx      - year (1980-2099)   (as expected by system set
  144. ;                   dh      - month (1-12)       date service int 21h, 2Bh)
  145. ;                   dl      - day (1-31)
  146. ;------------------
  147. ;
  148. ;   CALENDAR TO JULIAN DATE
  149. ;       Function 11h: Convert calendar date to julian date
  150. ;           Operation: Converse of Function 10h, except that calendar
  151. ;               date string is normalized to 9-byte or 11-byte ASCIIZ form
  152. ;               (mm/dd/yy+terminal NULL or mm/dd/yyyy+NULL, depending on
  153. ;               whether year was 2 or 4 bytes to begin with). If year was
  154. ;               passed in as 2 bytes, default century prefix is 19.
  155. ;               '  /  /  ' is copied to the  string if format is illegal.
  156. ;           Entry:  ds:si   - pointer to ASCIIZ source string (11 bytes min)
  157. ;                   bh      - 11h
  158. ;           Return: Same as Function 10h
  159. ;------------------
  160. ;
  161. ;   GET SYSTEM DATE
  162. ;       Function 12h: Get today's date from system and convert
  163. ;               to julian and calendar date
  164. ;           Entry:  ds:si   - pointer to destination string for cal date
  165. ;                   cx      - number of digits to display year (2 or 4),
  166. ;                               if century prefix is 19.
  167. ;                               (If not 19, 4 digits will be shown.)
  168. ;                   bh      - 12h
  169. ;           Return: Same as Function 10h
  170. ;------------------
  171. ;
  172. ;   SET SYSTEM DATE
  173. ;       Function 13h: Set date in system from ASCIIZ string
  174. ;           Entry:  ds:si   - pointer to source string of form mm/dd/yy or
  175. ;                               mm/dd/yyyy
  176. ;                   bh      - 13h
  177. ;           Return: Same as Function 10h
  178. ;------------------
  179. ;
  180. ;   TIME (SECONDS) TO ASCIIZ STRING
  181. ;       Function 15h: Convert time in seconds to string
  182. ;           Entry:  ds:si   - pointer to destination string for time
  183. ;                               Will be normalized to form hh:mm:ss
  184. ;                   dx:ax   - double word number of seconds since midnite
  185. ;                   bh      - 15h
  186. ;           Return: dx:ax   - double word number of seconds since midnite
  187. ;                   ch      - hours
  188. ;                   cl      - minutes
  189. ;                   bh      - seconds (similar to DOS get time utility,
  190. ;                   bl      - 0         except seconds:100ths in bx)
  191. ;------------------
  192. ;
  193. ;   ASCIIZ STRING TO TIME (SECONDS)
  194. ;       Function 16h: Convert string time to time in seconds
  195. ;                       Procedure normalizes string time to form hh:mm:ss
  196. ;           Entry:  ds:si   - pointer to source string for time
  197. ;                   bh      - 16h
  198. ;           Return: Same as Function 15h
  199. ;------------------
  200. ;
  201. ;   GET SYSTEM TIME
  202. ;       Function 17h: Get system time and convert to string and seconds
  203. ;           Entry:  ds:si   - destination string pointer
  204. ;                   bh      - 17h
  205. ;           Return: Same as Function 15h
  206. ;------------------
  207. ;
  208. ;   SET SYSTEM TIME
  209. ;       Function 18h: Set system time from ASCIIZ string
  210. ;           Entry:  ds:si   - source string pointer (hh:mm:ss)
  211. ;                   bh      - 18h
  212. ;           Return: Same as Function 15h
  213. ;------------------
  214. ;
  215. ;   TIMER
  216. ;       Function 19h: Elapsed time timer
  217. ;           Entry:  bh      - 19h
  218. ;           Return: dx:ax   - Elapsed seconds since previous midnight
  219. ;                   bx      - Elapsed seconds since last call to timer
  220. ;------------------
  221. ;
  222. ;   ASCIIZ STRING COPY
  223. ;       Function 20h: String copy to NULL
  224. ;           Entry:  ds:si   - source string pointer
  225. ;                   ds:di   - destination string pointer
  226. ;                   bh      - 20h
  227. ;           Return: None
  228. ;------------------
  229. ;
  230. ;   ASCIIZ STRING LENGTH
  231. ;       Function 21h: String length
  232. ;           Entry:  ds:si   - source string pointer
  233. ;                   bh      - 21h
  234. ;           Return: ax      - string length
  235. ;------------------
  236. ;
  237. ;   ASCIIZ STRING CONCATENATE
  238. ;       Function 22h: String concatenate
  239. ;           Entry:  ds:di   - pointer to string to which source string is
  240. ;                               to be added
  241. ;                   ds:si   - pointer to source string to be concatenated
  242. ;                               to ds:di
  243. ;                   bh      - 22h
  244. ;           Return: None
  245. ;------------------
  246. ;
  247. ;   ASCIIZ STRING COMPARE
  248. ;       Function 23h: String compare
  249. ;           Entry:  ds:si   - pointer to string 1
  250. ;                   ds:di   - pointer to string 2
  251. ;                   cx      - max number of bytes to compare
  252. ;                   bh      - 23h
  253. ;           Return: ax      - 1 if str1>str2, 0 if str1=str2, -1 if str1<str2
  254. ;                   bx      - unsigned number = position of differing byte
  255. ;------------------
  256. ;
  257. ;   ASCIIZ STRING SWAP
  258. ;       Function 24h: String swap
  259. ;           Entry:  ds:si   - pointer to string 1
  260. ;                   ds:di   - pointer to string 2
  261. ;                   cx      - string length
  262. ;                   bh      - 24h
  263. ;           Return: None
  264. ;------------------
  265. ;
  266. ;   ASCIIZ STRING IMBED
  267. ;       Function 25h: String imbed - Imbeds source string at destination
  268. ;               offset, but does not copy terminal NULL. Good for implanting
  269. ;               ASCII data into a print line.
  270. ;           Entry:  ds:si   - pointer to source string
  271. ;                   ds:di   - pointer to imbed destination
  272. ;                   bh      - 25h
  273. ;           Return: None
  274. ;------------------
  275. ;
  276. ;   ASCIIZ STRING ALL CAPS
  277. ;       Function 26h: All caps - Capitalizes all lower case letters in the
  278. ;               ASCIIZ string pointed to by ds:si; max of cx characters
  279. ;           Entry:  ds:si   - pointer to string to be capitalized
  280. ;                   cx      - maximum number of chars to capitalize
  281. ;                   bh      - 26h
  282. ;           Return: None
  283. ;------------------
  284.  
  285.  
  286.  
  287.  
  288.